<div class="modal-header">
    用户登录
</div>
<div class="modal-body">
    <form class="form-horizontal" name="loginForm" novalidate>
        <div class="form-group">
            <label class="col-xs-2 control-label">登录名：</label>
            <div class="col-xs-8">
                <input type="text" name="userName" class="form-control" ng-model="user.loginName"
                       ng-class="{'error': loginForm.$invalid && submitted && loginForm.userName.$error.required}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label">密&emsp;码：</label>
            <div class="col-xs-8">
                <input type="password" name="password" class="form-control" ng-model="user.password"
                       ng-class="{'error': loginForm.$invalid && submitted && loginForm.password.$error.required}" required yb-focus>
            </div>
        </div>
        <div class="form-group m-b-none">
            <label class="col-xs-2 control-label">验证码：</label>
            <div class="col-xs-6">
                <input type="text" name="validateCode" class="form-control" ng-model="user.code"
                       ng-class="{'error': loginForm.$invalid && submitted && loginForm.validateCode.$error.required}" required>
            </div>
            <div class="col-xs-2">
                <img class="cursor-pointer" ng-src="{{ codeImg| ApiUrl }}" ng-click="refresh()" style="height: 34px">
            </div>
        </div>
        <div class="form-group m-b-none">
            <label class="col-xs-2 control-label"></label>
            <div class="col-xs-8">
                <span class="danger-color" ng-show="failLogin&&!submitted">{{Message}}</span>
            </div>
        </div>
        <div class="form-group m-b-xs">
            <label class="col-xs-2 control-label"></label>
            <div class="col-xs-8">
                <button type="submit" class="btn btn-primary btn-modal m-r-sm" ng-click="login(loginForm.$valid)">登录</button>
                <button type="button" class="btn btn-default btn-modal" ng-click="cancel()">取消</button>
            </div>
        </div>
    </form>
</div>